<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-student-student-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">姓名：</label>
				<div class="col-sm-8">
					<input id="name" name="name" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">性别：</label>
				<div class="col-sm-8" th:with="type=${@dict.getType('sys_user_sex')}">
					<div th:each="dict : ${type}" th:class="${dict['cssClass']}">
						<input type="radio" th:id="${dict['dictCode']}" name="sex" th:value="${dict['dictValue']}" th:checked="${dict['isDefault'] == 'Y' ? true : false}">
						<label th:for="${dict['dictCode']}" th:text="${dict['dictLabel']}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">电话号：</label>
				<div class="col-sm-8">
					<input name="telephone" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">家庭住址：</label>
				<div class="col-sm-8">
					<input name="address" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">现读班级：</label>
				<div class="col-sm-8">
					<select id="nowClass" name="nowClassId" class="form-control">
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script th:src="@{/ajax/libs/select/select2.js}"></script>
    <script type="text/javascript">
    	$(function(){
    		var prefix = ctx + "module/student/student"
    		
    		$("#nowClass").select2({
				ajax: {
			        type:'GET',
			        url: prefix + "/queryClassFormatSelect2",
			        delay: 250,
			        cache: true
			    }
			});
    		
    		$("#form-student-student-add").validate({
    			rules:{
    				xxxx:{
    					required:true,
    				},
    			},
    			submitHandler: function(form) {
    				$.operate.save(prefix + "/add", $(form).serialize());
    			}
    		});
    	});
	</script>
</body>
</html>
